package 装饰模式.计算器实例;



import java.util.Scanner;

/**
 * @author zyl
 * @Description
 * @since 2023/12/26 9:48
 */

public class Client {
    public static void main(String[] args) throws InterruptedException {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入数字A");
        Double numberA = Double.valueOf(sc.nextLine());
        System.out.println("请输入运算符(+,-,*,/):");
        String operator = sc.nextLine();
        System.out.println("请输入数字B");
        Double numberB = Double.valueOf(sc.nextLine());
        Double result = null;

        OperationContext operationContext = new OperationContext(operator);
        result = operationContext.getResult(numberA,numberB);
        System.out.println("结果是:" + result);


    }

}
